package com.ygo.feihua.util;

import android.content.*;
import com.ygo.feihua.logo.*;
import com.ygo.feihua.*;

public class SharedPreferenceUtil
{
	public final static int IMAGE_ALL=0;
	public final static int IMAGE_WIFI=1;
	public final static int IMAGE_NO=2;

	public final static int TYPE_BUILT_IN=0;
	public final static int TYPE_EXTERNAL=1;
	
	
	//获取存放路径的share
	public static SharedPreferences getSharePath(){
		return OurygoApplication.getContext().getSharedPreferences("path",OurygoApplication.getContext().MODE_PRIVATE);
	}
	//获取存放类型的share
	public static SharedPreferences getShareType(){
		return OurygoApplication.getContext().getSharedPreferences("type",OurygoApplication.getContext().MODE_PRIVATE);
	}
	//获取存放开关状态的share
	public static SharedPreferences getShareKaiguan(){
		return OurygoApplication.getContext().getSharedPreferences("kaiguan",OurygoApplication.getContext().MODE_PRIVATE);
	}
	//获取各种记录的share
	public static SharedPreferences getShareRecord(){
		return OurygoApplication.getContext().getSharedPreferences("record",OurygoApplication.getContext().MODE_PRIVATE);
	}
	//获取打开资源更新界面是否提示用户使用说明
	public static boolean getKgZyToast(){
		return getShareKaiguan().getBoolean("zygx",true);
	}
	//获取启动界面是否弹出免责声明
	public static boolean getKgSpDialog(){
		return getShareKaiguan().getBoolean("spmz",true);
	}
	//获取是否上传用户位置
	public static boolean getKgUploadLocation(){
		return getShareKaiguan().getBoolean("scwz",false);
	}
	//获取各种记录的share
	public static SharedPreferences getShareDuelInfo(){
		return OurygoApplication.getContext().getSharedPreferences("duel_info",OurygoApplication.getContext().MODE_PRIVATE);
	}


	
	public static int getBrowserIntent(){
		return getShareType().getInt("intent_browser",TYPE_BUILT_IN);
	}



	//获取图片显示方式
	public static int getImageXs(){
		return getShareType().getInt("imagexs",IMAGE_ALL);
	}
	//获取应用的启动次数
	public static int getAppStartTimes(){	
		return getShareRecord().getInt("StartTimes",0);
	}

	//获取ygo资源路径
	public static String getYgopath(){
		SharedPreferences paths=getSharePath();  
		return paths.getString("ygopath",Gongju.PATH_MOBILE);
	}

	//获取数据库资源路径
	public static String getCdbpath(){
		SharedPreferences paths=getSharePath();  
		return paths.getString("cdbpath",Gongju.PATH_EZ_MANAGEMENT+"cards.cdb");
	}

	public static String getDuelIp(){
		return getShareDuelInfo().getString("ip","s1.ygo233.com");
	}
	public static int getDuelPort(){
		return getShareDuelInfo().getInt("port",233);
	}
	public static String getDuelName(){
		return getShareDuelInfo().getString("name","好吃的喵");
	}

	
	
	
}
